package osgi.common.services.util;

import java.util.Dictionary;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;

public class Util {
	

	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static Map<String, ? extends Object> dictionaryToMap ( Dictionary target ){
		
		Map props = new HashMap();
		
		//logger.warn("Util dictionaryToMap :");
		for (Enumeration e = target.keys() ; e.hasMoreElements() ;) {
			
	         String chave = (String) e.nextElement();
	         
	         //logger.info("   Chave : "+chave);
	         //logger.info("   Valor : "+target.get(chave));
	         //logger.info("...................................");   
	         
	         props.put(chave, target.get(chave));
	         
	     }

		return props;
	}
}
